package day15;

class Cow{
	private double weight;  //体重
	
	public Cow(double weight) {
		this.weight = weight;
	}
	
	private class CowLeg{
		private int length;  
		
		CowLeg( int length){
			this.length = length;
		}
		
		public void info() {
			System.out.println("牛腿有"+this.length+"只");
			//直接用外部类属性
			System.out.println("牛有多重" + weight);
		}
	}
	
	public void test() {
		CowLeg legs= new CowLeg(4);
		legs.info();
	}
}

public class Test1 {

	public static void main(String[] args) {
		Cow c = new Cow(1000);
		c.test();
		
		 
				 
	}

}
